// ts 里面是引入了他的需求 输入的接口，获取月度账单的总览 通过引入模块的方式引入到vue中
import request from './request' // 引入需求
import { QueryPageDto, QueryDateOtherSlotDto } from './dto'
interface GetBillListDto extends QueryPageDto, QueryDateOtherSlotDto{
} // 扩大原型extends
export interface BillDto{ // 输出接口BillDto的接口
    payReceivePeopleNum: 0 // 已领人数
    payReceiveTotalMoney: 0 // 已领金额
    payTotalMoney: 0 // 发薪总金额
    payUnclaimedTotalMoney: 0 // 未领金额
    serveCompanyName: string // 公司名称
    totalPeopleNum: 0 // 账单人数
}
// 获取账单列表
export function getBillList (params: GetBillListDto): Promise<{total: number, list: BillDto[]}> { // Promise 承诺数字
    return request.get('/rest/pay/pay-payment-record/server-company-statistics', {
        params
    })
}
// 获取月度账单总览
export function getBillInfo (params: QueryDateOtherSlotDto): Promise<{allMoney: number, alrMoney: number, waitMoney:number}> {
    return request.get('/rest/pay/pay-payment-record/statistics', {
        params
    })
}

// 账单详情
interface getBillDetailInfoDto extends QueryDateOtherSlotDto{
    serveCompanyId: string
}
export function getBillDetailInfo (params: getBillDetailInfoDto): Promise<{list:BillDto[]}> {
    return request.get('/rest/pay/pay-payment-record/server-company-statistics', {
        params
    })
}

interface getBillDetailListDto extends QueryDateOtherSlotDto, QueryPageDto{
    serveCompanyId: string,
    queryStatus?:string | null
    detailRemarks?:string
}
export interface BillDetailDto{
    idCardNo?:string,
    id: number
    userName: string
    projectName: string
    paymentAmount: number
    payTime: string
    getSalaryTime: string
    billStatusMsg: string
    statusMsg: string
    detailRemarks?: string
}
// 账单详情详单
export function getBillDetailList (params: getBillDetailListDto): Promise<{total: number, list: BillDetailDto[]}> {
    return request.get('/rest/pay/pay-payment-record/statistics-info', {
        params
    })
}
export interface BillStatisticsDto{
    userName: string
    idCardNo: string
    payReceiveTotalCount: number
    payTotalMoney: number
    getSalaryTime: string
}
// 账单详情统计
export function getBillDetailStatistics (params: getBillDetailListDto): Promise<{total: number, list: BillStatisticsDto[]}> {
    return request.get('/rest/pay/pay-payment-record/statistics-worker-info', {
        params
    })
}
